package testPackage;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;

/**
 * step by step 09
 * 实现双击
 * action.doubleClick(element).perform()
 */
public class Slenium10 {
    public static void main(String[] args) {
        String str = "D:\\\\Enviroments\\\\geckodriver-v0.26.0-win64\\\\chromedriver.exe";
        System.setProperty("webdriver.chrome.driver",str);
        WebDriver driver = new ChromeDriver();
        driver.get("https://tb.alicdn.com/snapshot/index.html");
        driver.manage().window().maximize();
        //双击
        //创建Actions类对象
        Actions action = new Actions(driver);
        //WebElement element = driver.findElement(By.id("J_TSearchForm"));
        //获取要双击的元素
        WebElement element = driver.findElement(By.xpath("//*[@id=\"J_TSearchForm\"]/div[1]/button"));
        ////*[@id="J_TSearchForm"]/div[1]/button
        //执行双击的动作
        action.doubleClick(element).perform();

    }
}
